Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mix.exs to Phoenix 1.4 #13

Merged
merged 3 commits into from
Nov 16, 2018
Merged

Conversation

nelsonic
Copy link
Member

@nelsonic nelsonic commented Nov 16, 2018

@iteles just noticed that I forgot to update the version of Phoenix in the mix.exs file ... 🙄 (derp!)

note: I have it updated on my "personal walkthrough" of this example: https://github.com/nelsonic/phoenix-chat-v1.4/blob/059db8850bee14d95f0caeb12d54d7485d402503/mix.exs#L36 but forgot to do it here!

Thanks for reviewing/merging. 👍

@nelsonic nelsonic added the enhancement New feature or request label Nov 16, 2018
@nelsonic nelsonic requested a review from iteles November 16, 2018 03:44
@nelsonic
Copy link
Member Author

https://travis-ci.org/dwyl/phoenix-chat-example/builds/455809393#L667
image

** (ArgumentError) invalid :json_decoder option. The module Poison is not loaded and could not be found

😞

@nelsonic nelsonic assigned nelsonic and unassigned iteles Nov 16, 2018
@nelsonic nelsonic removed the request for review from iteles November 16, 2018 03:56
@nelsonic
Copy link
Member Author

@nelsonic
Copy link
Member Author

warning: failed to load Jason for Phoenix JSON encoding
(module Jason is not available).

Ensure Jason exists in your deps in mix.exs,
and you have configured Phoenix to use it for JSON encoding by
verifying the following exists in your config/config.exs:

    config :phoenix, :json_library, Jason


  (phoenix) lib/phoenix.ex:40: Phoenix.start/2
  (kernel) application_master.erl:277: :application_master.start_it_old/4

@nelsonic
Copy link
Member Author

image

run:

cd assets && npm install && cd ..

@codecov
Copy link

codecov bot commented Nov 16, 2018

Codecov Report

Merging #13 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #13   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           6      6           
  Lines          19     20    +1     
=====================================
+ Hits           19     20    +1
Impacted Files Coverage Δ
lib/chat_web/router.ex 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8047714...6966b1d. Read the comment docs.

@nelsonic
Copy link
Member Author

Generated chat app
** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "messages" already exists
    (ecto_sql) lib/ecto/adapters/sql.ex:590: Ecto.Adapters.SQL.raise_sql_call_error/1
    (elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
    (ecto_sql) lib/ecto/adapters/sql.ex:677: Ecto.Adapters.SQL.execute_ddl/4
    (ecto_sql) lib/ecto/migration/runner.ex:272: Ecto.Migration.Runner.log_and_execute_ddl/3
    (ecto_sql) lib/ecto/migration/runner.ex:105: anonymous fn/2 in Ecto.Migration.Runner.flush/0
    (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto_sql) lib/ecto/migration/runner.ex:103: Ecto.Migration.Runner.flush/0
    (stdlib) timer.erl:181: :timer.tc/2

Tried to "drop" using mix task: https://hexdocs.pm/ecto/Mix.Tasks.Ecto.Drop.html

mix ecto.drop
mix ecto.create
mix ecto.migrate
mix test

Failed!

had to go nuclear: https://stackoverflow.com/questions/7073773/drop-postgresql-database-through-command-line

psql -U postgres -c "drop database chat_test"

obviously I got the following error:

-bash: psql: command not found

(new computer ...)

see: https://postgresapp.com/documentation/cli-tools.html

sudo mkdir -p /etc/paths.d &&
echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp

Once psql was linked, I was able to drop the chat_dev database and re-run the tests:

image

Copy link
Member

@iteles iteles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This debugging was a super useful process to read through, I need a better system to 'star' specific pulls or issues to come back to!

@iteles iteles merged commit e98e854 into master Nov 16, 2018
@iteles iteles deleted the update-mix.exs-to-phoenix-1.4 branch November 16, 2018 08:41
@pdxrod
Copy link

pdxrod commented Aug 16, 2020

I have the same problem as above
" The module Poison is not loaded and could not be found" when I run 'mix phx.server'
I've followed all the steps above, and it makes no difference
in mix.exs
{:phoenix, "> 1.4.0"},
{:json, "
> 1.2"}
in endpoint.ex
json_decoder: Phoenix.json_library()
In config.exs
config :phoenix, json_library: Jason
None of these steps solve the problem
They just make the error message different:
"The module Jason is not loaded and could not be found" when I run 'mix phx.server'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants